home *** CD-ROM | disk | FTP | other *** search
Wrap
#!/bin/sh # # The following CDware script launches httpd, waissearch, and Netscape # on Solaris SPARC, Solaris x86, and SunOS # Author: Marc Sacoolas (marc.sacoolas@sun.com) # Date: April 4, 1995 # below is for the cgi-scripts DISC_NAME=CDware_May-1996 # below is for everything else disc_name="CDware";disc_rest="CDware May 1996" export disc_name disc_rest # initialize variables dir_exist=0 echo "" echo " Catalyst $disc_name initializing ..." echo "" # set CDMOUNT to path from the command line arguements CDMOUNT=`expr \ $0'/' : '\(/\)[^/]*//*$' \ \| $0'/' : '\(.*[^/]\)//*[^/][^/]*//*$' \ \| .` # if command line path is current directory then set CDMOUNT to pwd # CDMOUNT cannot be set to . because other programs/scripts # need the absolute path in CD_MOUNT if [ "$CDMOUNT" = "." ]; then CDMOUNT=`pwd` fi CD_MOUNT=$CDMOUNT export CD_MOUNT PID_CDWARE PID_CATALOG dir_exist if [ -h $HOME/.netscape/lock ]; then echo '\07' echo "It looks like you are currently running Netscape Navigator." echo "You should quit it before running $disc_rest!" echo "Press <RETURN> to continue or <CTRL> C to abort..." read a fi # # os type and arch # check_os() { os_ver="`/bin/uname -r | /bin/grep 5\[.]`" export os_ver if [ -n "$os_ver" ]; then # must be running Solaris 2.x machine_type="`/bin/uname -m`" os_type="`/bin/uname -r`" if [ "$machine_type" = "i86pc" ]; then OS_TYPE="" CDWARE_ENV=Solaris_x86 else # must be on a SPARCarchitecture-based machine bcp="`/bin/pkginfo | /bin/grep SUNWbcp`" # check for bcp and set CDWARE_ENV accordingly??? CDWARE_ENV=Solaris_2 fi else # must be running Solaris 1.x GUI=.products/bin/Solaris_1/cdmanager GUI_BIN=cdmgr CDWARE_ENV=Solaris_1 fi # # CDWARE_HOME used by screendemo, slidecacher, and seaudio # CDWARE_HOME=$CDMOUNT/.products/bin/$CDWARE_ENV$OS_TYPE export GUI CDWARE_ENV CDWARE_HOME OS_TYPE } # print out legal text as required by the lawyers echo " " cat $CD_MOUNT/.products/$disc_name/legal.txt check_os if [ "$OPENWINHOME" != "" ]; then OPENWINHOME="/usr/openwin"; export OPENWINHOME fi export LD_LIBRARY_PATH HOTJAVA_HOME CLASSPATH PATH LD_LIBRARY_PATH=$CD_MOUNT/.products/.lib/$CDWARE_ENV/lib:/usr/openwin/lib:/usr/lib CLASSPATH=./:$CD_MOUNT/.products/.bin/gui/$CDWARE_ENV:$CD_MOUNT/.products/.bin/gui//classes:$CD_MOUNT/.products/$disc_name/classes if [ "$CDWARE_ENV" = "Solaris_1" ]; then PATH=/tmp/httpd/.cgi-bin:/usr/ucb:$OPENWINHOME/bin:/usr/bin:/usr/sbin:$PATH XNLSPATH=$CD_MOUNT/.products/.bin/gui/$CDWARE_ENV/nls XKEYSYMDB=$CD_MOUNT/.products/.bin/gui/$CDWARE_ENV else PATH=/tmp/httpd/.cgi-bin:/usr/bin:$OPENWINHOME/bin:/usr/sbin:$PATH fi # play welcome audio clip if [ $CDWARE_ENV != "Solaris_1" ]; then audioplay -i $CD_MOUNT/.products/$disc_name/sounds/welcome.au& else cat $CD_MOUNT/.products/$disc_name/sounds/welcome.au > /dev/audio& fi set the dir where all the companies live PRODUCT_DIR=$CD_MOUNT/.products export PRODUCT_DIR export WWW_HOME # if "/tmp/.wais" symlink is not already there, then # create link for wais-src and wais on CDrom if [ ! -h /tmp/.wais ]; then ln -s $PRODUCT_DIR/.wais /tmp fi # move only needed files and symlink for "file" URLs, if necessary if [ ! -d /tmp/httpd ]; then mkdir /tmp/httpd mkdir /tmp/httpd/bin mkdir /tmp/httpd/conf mkdir /tmp/httpd/cache cp -r $CD_MOUNT/.products/.bin/httpd/conf /tmp/httpd& cp -r $CD_MOUNT/.products/.bin/httpd/logs /tmp/httpd& ln -s $PRODUCT_DIR /tmp/httpd fi # create temp mailcap file key=$ #MAILCAP=/tmp/.mailcap #export MAILCAP echo "application/x-key-sh; /bin/sh %s " > /tmp/httpd/.$disc_name echo "application/postscript; $OPENWINHOME/bin/pageview %s " >> /tmp/httpd/.$disc_name # needed srm.conf doc for httpd conf echo "" echo " NCSA World Wide Web server initializing ..." echo "" echo " Portions developed at the National Center" echo " for Supercomputing Applications at the" echo " University of Illinois at Urbana-Champaign." echo "" if [ ! -h /tmp/httpd/.cgi-bin ]; then ln -s $PRODUCT_DIR/.bin/httpd/$CDWARE_ENV /tmp/httpd/.cgi-bin fi # if slower machine, use non-imaged mapped page if [ "`/bin/uname -m | sed 's/sun4//g'" = "c" -o "`/bin/uname -m | sed 's/i86//g'" = "pc" -a "$1" != "fast" -o "$1" = "slow" ]; then ln -s $PRODUCT_DIR/$disc_name/index.4c /tmp/httpd/index.html #WWW_HOME=$CDMOUNT/.products/$disc_name/index.4c WWW_HOME=/tmp/httpd/.products/CDware/index.4c else ln -s $PRODUCT_DIR/$disc_name/index.4x /tmp/httpd/index.html #WWW_HOME=$CDMOUNT/.products/$disc_name/index.4x WWW_HOME=/tmp/httpd/.products/CDware/index.4x fi #wais_conf() #{ echo "DocumentRoot $CD_MOUNT/.products" >> /tmp/httpd/conf/srm.conf echo 'UserDir public_html' >> /tmp/httpd/conf/srm.conf echo 'HeaderName public_html' >> /tmp/httpd/conf/srm.conf echo 'DirectoryIndex index.html' >> /tmp/httpd/conf/srm.conf echo 'FancyIndexing on' >> /tmp/httpd/conf/srm.conf echo 'AddType application/x-key-sh .sh' >> /tmp/httpd/conf/srm.conf echo 'AddIconByType (TXT,/icons/text.xbm) text/*' >> /tmp/httpd/conf/srm.conf echo 'AddIconByType (IMG,/icons/image.xbm) image/*' >> /tmp/httpd/conf/srm.conf echo 'AddIconByType (SND,/icons/sound.xbm) audio/*' >> /tmp/httpd/conf/srm.conf echo 'AddIcon /icons/movie.xbm .mpg .qt' >> /tmp/httpd/conf/srm.conf echo 'AddIcon /icons/binary.xbm .bin' >> /tmp/httpd/conf/srm.conf echo 'AddIcon /icons/back.xbm ..' >> /tmp/httpd/conf/srm.conf echo 'AddIcon /icons/menu.xbm ^^DIRECTORY^^' >> /tmp/httpd/conf/srm.conf echo 'AddIcon /icons/blank.xbm ^^BLANKICON^^' >> /tmp/httpd/conf/srm.conf echo 'DefaultIcon /icons/unknown.xbm' >> /tmp/httpd/conf/srm.conf echo 'ReadmeName README' >> /tmp/httpd/conf/srm.conf echo 'HeaderName HEADER' >> /tmp/httpd/conf/srm.conf echo 'IndexIgnore */.??* *~ *# */HEADER* */README*' >> /tmp/httpd/conf/srm.conf echo 'AccessFileName .htaccess' >> /tmp/httpd/conf/srm.conf echo 'DefaultType text/plain' >> /tmp/httpd/conf/srm.conf echo "ScriptAlias /.categories/ /tmp/httpd/.cgi-bin/show.pl" >> /tmp/httpd/conf/srm.conf echo "ScriptAlias /cgi-bin/ $CD_MOUNT/.products/.bin/httpd/cgi-bin/" >> /tmp/httpd/conf/srm.conf #echo "Alias /docs/ $CD_MOUNT/.products/$disc_name/docs/" >> /tmp/httpd/conf/srm.conf # generate access.conf file echo '<Directory /tmp/httpd/>' >> /tmp/httpd/conf/access.conf echo 'Options Indexes FollowSymLinks' >> /tmp/httpd/conf/access.conf echo '</Directory>' >> /tmp/httpd/conf/access.conf echo "<Directory $CD_MOUNT/.products/*>" >> /tmp/httpd/conf/access.conf echo 'Options Indexes FollowSymLinks ExecCGI' >> /tmp/httpd/conf/access.conf echo 'AllowOverride All' >> /tmp/httpd/conf/access.conf echo '<Limit GET>' >> /tmp/httpd/conf/access.conf echo 'order allow,deny' >> /tmp/httpd/conf/access.conf echo 'allow from all' >> /tmp/httpd/conf/access.conf echo '</Limit>' >> /tmp/httpd/conf/access.conf echo '</Directory>' >> /tmp/httpd/conf/access.conf # generate imagemap.conf #echo " : " > /tmp/httpd/conf/imagemap.conf # append ServerName to http file for disc specification echo "ServerName $DISC_NAME" >> /tmp/httpd/conf/httpd.conf-dist # make link to *real* cgi-bin dirctory # Check to see if the user is root, if so, change to # "-nobody" # USER=`/usr/ucb/whoami` if [ "$USER" = "root" ]; then echo "User nobody" >>/tmp/httpd/conf/httpd.conf-dist if [ "$CDWARE_ENV" = "Solaris_1" ]; then echo "Group nogroup" >>/tmp/httpd/conf/httpd.conf-dist else echo "Group nobody" >>/tmp/httpd/conf/httpd.conf-dist fi fi # launch wais search deamen echo " Launching Catalyst Catalog WAIS server ..." echo "" echo " Copyright (c) MCNC, Clearinghouse for Networked" echo " Information Discovery and Retrieval, 1993." export PID_CDWARE PID_CATALOG $CD_MOUNT/.products/.bin/httpd/cgi-bin/waisserver -p 7998 -d $CD_MOUNT/.products/.wais/wais >/tmp/waisserver.log & PID_CDWARE=$! $CD_MOUNT/.products/.bin/httpd/cgi-bin/waisserver -p 7997 -d $CD_MOUNT/.products/.wais/wais_$disc_name >/tmp/waisserver.log & PID_CATALOG=$! #launch httpd $CD_MOUNT/.products/.bin/httpd/cgi-bin/httpd -f /tmp/httpd/conf/httpd.conf-dist #} #wais_conf& echo "" echo " NOTE: If you have internet access through" echo " a fire-wall, you may have to set a \"proxy\"" echo " server under \"Network options\" in Netscape." #WHERE="`/usr/bin/which netscape`" #echo "WHERE="$WHERE #Looks for a version of Netscape later than 2.01 #NETSCAPE_FULL_VERSION="`netscape -version 2>&1|grep -v found`" #echo "FULL_VERSION="$NETSCAPE_FULL_VERSION export PATH PATH=$PATH:$CD_MOUNT/.products/.bin/gui/$CDWARE_ENV #which netscape NETSCAPE_VERSION="`netscape -version 2>&1| /tmp/httpd/.cgi-bin/perl -n -e 's?\D*([0-9.]*).*?\1? ? print : print "none"'`" #echo "VERSION="$NETSCAPE_VERSION #NETSCAPE_VERSION="2.02" POST_VERSION_201=`echo $NETSCAPE_VERSION|/tmp/httpd/.cgi-bin/perl -n -e '/2\.(\d[2-9]|[1-9]\d)/ || /[3-9]\./ ? print "post" : print "ant"'` #echo "POST_VERSION_201="$POST_VERSION_201 if [ $POST_VERSION_201 = "post" ];then #echo "BEF="$NETSCAPE_VERSION #if [ ! -x $NETSCAPE_VERSION ];then #echo "" #echo " A version of Netscape Navigator older than 2.01 has been detected on your machine. The Catalyst CDware CD will use Netscape Navigator 2.01 on the CD." #echo "" #fi #else #echo "AFTER="$NETSCAPE_VERSION echo echo "WARNING: a version of Netscape Navigator 2.01 or later has been detected in your PATH!" echo "Netscape Navigator "$NETSCAPE_VERSION" will be used for the Catalyst CDware CD" echo "" #echo $PATH NETSCAPE_CATALYST=`echo $PATH|/tmp/httpd/.cgi-bin/perl -n -e ' @DIRS=split(/:/); foreach $dir (@DIRS) { if (-x "$dir/netscape" && -f _) { print "$dir/netscape\n"; last; } }'` export NETSCAPE_CATALYST #echo "NETSCAPE_CATALYST="$NETSCAPE_CATALYST fi if [ -d $HOME/.netscape ]; then perl -p -i.SunCD -e 's?^NO_PROXY:.*$?NO_PROXY: localhost?; s?^SHOW_DIRECTORY_BUTTONS:.*$?SHOW_DIRECTORY_BUTTONS: False?; s?^SHOW_URL:.*$?SHOW_URL: True?; s?^AUTOLOAD_IMAGES:.*$?AUTOLOAD_IMAGES: True?; s?^MIME_TYPES:.*$?MIME_TYPES: /tmp/httpd/conf/mime.types?; s?^PERSONAL_MIME_TYPES:.*$?PERSONAL_MIME_TYPES: /tmp/httpd/conf/mime.types?; s?^MAILCAP:.*$?MAILCAP: /tmp/httpd/.CDware?; s?^PERSONAL_MAILCAP:.*$?PERSONAL_MAILCAP: /tmp/httpd/.CDware?; s?^HOME_DOCUMENT:.*$?HOME_DOCUMENT: file:///tmp/httpd/.products/CDware/index.4c?; s?^DISABLE_JAVA:.*$?DISABLE_JAVA: False?; s?^SHOW_TOOLBAR:.*$?SHOW_TOOLBAR: True?; s?^WARN_ENTER_SECURE:.*$?WARN_ENTER_SECURE: False?; s?^WARN_LEAVE_SECURE:.*$?WARN_LEAVE_SECURE: False?; s?^WARN_MIXED_SECURE:.*$?WARN_MIXED_SECURE: False?; s?^WARN_SUBMIT_INSECURE:.*$?WARN_SUBMIT_INSECURE: False?; s?^SHOW_URL:.*$?SHOW_URL: False?; s?^SHOW_DIRECTORY_BUTTONS:.*$?SHOW_DIRECTORY_BUTTONS: False?; s?^AUTOLOAD_IMAGES:.*$?AUTOLOAD_IMAGES: True?; s?^FTP_FILE_INFO:.*$?FTP_FILE_INFO: True?; s?^SHOW_SECURITY_BAR:.*$?SHOW_SECURITY_BAR True?; s?^FONT_SPEC:[ ]*([^-]*)-([^-]*)-([^-]*)-(.*)$?FONT_SPEC: \1-\2-140-\4?; ' $HOME/.netscape/preferences dir_exist=1 else cp -r $CD_MOUNT/.products/.bin/gui/.netscape $HOME dir_exist=0 fi echo "" echo "Catalyst $disc_name is starting ..." echo "" echo "Please note the following:" echo "--------------------------" echo "- To run many of the slide shows there must be at least 5 megabytes" echo " of available disk space in /tmp. Please verify the available disk" echo " space in /tmp before running the slide shows." echo " " echo " " ##$CD_MOUNT/.products/.bin/httpd/$CDWARE_ENV/welcome 120 & # cleanup previous line, if any perl -nei 'print unless $_ =~ "application/x-spam-sh; /bin/sh %s"' $HOME/.mailcap > /tmp/httpd/.mailcap; cp /tmp/httpd/.mailcap $HOME/.mailcap $CD_MOUNT/.products/.bin/finish.sh & sleep 120 exit 0